import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userInfo: JSON.parse(localStorage.getItem("userInfo")) || {}
  },
  mutations: {
    SET_USERINFO(context, val) {
      Object.assign(context.userInfo, val)
    },
    DELETE_USERINFO(context) {
      context.userInfo = ""
    },

  },
  actions: {},
  modules: {}
})